package com.model;

import java.util.List;
import com.dao.DaoSession;
import de.greenrobot.dao.DaoException;

import com.dao.AgendaDao;
import com.dao.ApiarioDao;
import com.dao.ApiarioFloraDao;
import com.dao.ApicultorDao;
import com.dao.CriaRainhasDao;
import com.dao.ManutencoesDao;
import com.dao.MelgueirasDao;
import com.dao.RainhasDao;
import com.dao.RegAlimentacoesDao;
import com.dao.RegEnxamesDao;
import com.dao.RegPragasDao;
import com.dao.TrocasCeraDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit. 
/**
 * Entity mapped to table APICULTOR.
 */
public class Apicultor {

    private long id;
    /** Not-null value. */
    private String Nome;
    /** Not-null value. */
    private String Morada;
    private String codPostal;
    /** Not-null value. */
    private String nif;
    private String telefone;
    private String telemovel;
    private String fax;
    private String email;
    /** Not-null value. */
    private java.util.Date dataCriacao;
    private String obs;
    private Boolean propri;
    private String codresi;
    private String foto;

    /** Used to resolve relations */
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    private transient ApicultorDao myDao;

    private List<Agenda> agendaApicultor;
    private List<Apiario> apiarioApicultor;
    private List<ApiarioFlora> flotaA_Flora;
    private List<CriaRainhas> apicultorCriaRainhas;
    private List<Manutencoes> apicultorManutencoes;
    private List<Melgueiras> apicultorMelgueiras;
    private List<Rainhas> apicultorRainhas;
    private List<RegAlimentacoes> apicultorRegAlimentacoes;
    private List<RegEnxames> apicultorRegExames;
    private List<RegEnxames> exameOrigemRegExames;
    private List<RegPragas> apicultorRegPragas;
    private List<TrocasCera> apicultorTorocaCera;

    public Apicultor() {
    }

    public Apicultor(long id) {
        this.id = id;
    }

    public Apicultor(long id, String Nome, String Morada, String codPostal, String nif, String telefone, String telemovel, String fax, String email, java.util.Date dataCriacao, String obs, Boolean propri, String codresi, String foto) {
        this.id = id;
        this.Nome = Nome;
        this.Morada = Morada;
        this.codPostal = codPostal;
        this.nif = nif;
        this.telefone = telefone;
        this.telemovel = telemovel;
        this.fax = fax;
        this.email = email;
        this.dataCriacao = dataCriacao;
        this.obs = obs;
        this.propri = propri;
        this.codresi = codresi;
        this.foto = foto;
    }

    /** called by internal mechanisms, do not call yourself. */
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getApicultorDao() : null;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    /** Not-null value. */
    public String getNome() {
        return Nome;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setNome(String Nome) {
        this.Nome = Nome;
    }

    /** Not-null value. */
    public String getMorada() {
        return Morada;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setMorada(String Morada) {
        this.Morada = Morada;
    }

    public String getCodPostal() {
        return codPostal;
    }

    public void setCodPostal(String codPostal) {
        this.codPostal = codPostal;
    }

    /** Not-null value. */
    public String getNif() {
        return nif;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setNif(String nif) {
        this.nif = nif;
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public String getTelemovel() {
        return telemovel;
    }

    public void setTelemovel(String telemovel) {
        this.telemovel = telemovel;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    /** Not-null value. */
    public java.util.Date getDataCriacao() {
        return dataCriacao;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setDataCriacao(java.util.Date dataCriacao) {
        this.dataCriacao = dataCriacao;
    }

    public String getObs() {
        return obs;
    }

    public void setObs(String obs) {
        this.obs = obs;
    }

    public Boolean getPropri() {
        return propri;
    }

    public void setPropri(Boolean propri) {
        this.propri = propri;
    }

    public String getCodresi() {
        return codresi;
    }

    public void setCodresi(String codresi) {
        this.codresi = codresi;
    }

    public String getFoto() {
        return foto;
    }

    public void setFoto(String foto) {
        this.foto = foto;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<Agenda> getAgendaApicultor() {
        if (agendaApicultor == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            AgendaDao targetDao = daoSession.getAgendaDao();
            List<Agenda> agendaApicultorNew = targetDao._queryApicultor_AgendaApicultor(id);
            synchronized (this) {
                if(agendaApicultor == null) {
                    agendaApicultor = agendaApicultorNew;
                }
            }
        }
        return agendaApicultor;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetAgendaApicultor() {
        agendaApicultor = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<Apiario> getApiarioApicultor() {
        if (apiarioApicultor == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ApiarioDao targetDao = daoSession.getApiarioDao();
            List<Apiario> apiarioApicultorNew = targetDao._queryApicultor_ApiarioApicultor(id);
            synchronized (this) {
                if(apiarioApicultor == null) {
                    apiarioApicultor = apiarioApicultorNew;
                }
            }
        }
        return apiarioApicultor;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApiarioApicultor() {
        apiarioApicultor = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<ApiarioFlora> getFlotaA_Flora() {
        if (flotaA_Flora == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ApiarioFloraDao targetDao = daoSession.getApiarioFloraDao();
            List<ApiarioFlora> flotaA_FloraNew = targetDao._queryApicultor_FlotaA_Flora(id);
            synchronized (this) {
                if(flotaA_Flora == null) {
                    flotaA_Flora = flotaA_FloraNew;
                }
            }
        }
        return flotaA_Flora;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetFlotaA_Flora() {
        flotaA_Flora = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<CriaRainhas> getApicultorCriaRainhas() {
        if (apicultorCriaRainhas == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            CriaRainhasDao targetDao = daoSession.getCriaRainhasDao();
            List<CriaRainhas> apicultorCriaRainhasNew = targetDao._queryApicultor_ApicultorCriaRainhas(id);
            synchronized (this) {
                if(apicultorCriaRainhas == null) {
                    apicultorCriaRainhas = apicultorCriaRainhasNew;
                }
            }
        }
        return apicultorCriaRainhas;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorCriaRainhas() {
        apicultorCriaRainhas = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<Manutencoes> getApicultorManutencoes() {
        if (apicultorManutencoes == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ManutencoesDao targetDao = daoSession.getManutencoesDao();
            List<Manutencoes> apicultorManutencoesNew = targetDao._queryApicultor_ApicultorManutencoes(id);
            synchronized (this) {
                if(apicultorManutencoes == null) {
                    apicultorManutencoes = apicultorManutencoesNew;
                }
            }
        }
        return apicultorManutencoes;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorManutencoes() {
        apicultorManutencoes = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<Melgueiras> getApicultorMelgueiras() {
        if (apicultorMelgueiras == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            MelgueirasDao targetDao = daoSession.getMelgueirasDao();
            List<Melgueiras> apicultorMelgueirasNew = targetDao._queryApicultor_ApicultorMelgueiras(id);
            synchronized (this) {
                if(apicultorMelgueiras == null) {
                    apicultorMelgueiras = apicultorMelgueirasNew;
                }
            }
        }
        return apicultorMelgueiras;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorMelgueiras() {
        apicultorMelgueiras = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<Rainhas> getApicultorRainhas() {
        if (apicultorRainhas == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            RainhasDao targetDao = daoSession.getRainhasDao();
            List<Rainhas> apicultorRainhasNew = targetDao._queryApicultor_ApicultorRainhas(id);
            synchronized (this) {
                if(apicultorRainhas == null) {
                    apicultorRainhas = apicultorRainhasNew;
                }
            }
        }
        return apicultorRainhas;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorRainhas() {
        apicultorRainhas = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<RegAlimentacoes> getApicultorRegAlimentacoes() {
        if (apicultorRegAlimentacoes == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            RegAlimentacoesDao targetDao = daoSession.getRegAlimentacoesDao();
            List<RegAlimentacoes> apicultorRegAlimentacoesNew = targetDao._queryApicultor_ApicultorRegAlimentacoes(id);
            synchronized (this) {
                if(apicultorRegAlimentacoes == null) {
                    apicultorRegAlimentacoes = apicultorRegAlimentacoesNew;
                }
            }
        }
        return apicultorRegAlimentacoes;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorRegAlimentacoes() {
        apicultorRegAlimentacoes = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<RegEnxames> getApicultorRegExames() {
        if (apicultorRegExames == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            RegEnxamesDao targetDao = daoSession.getRegEnxamesDao();
            List<RegEnxames> apicultorRegExamesNew = targetDao._queryApicultor_ApicultorRegExames(id);
            synchronized (this) {
                if(apicultorRegExames == null) {
                    apicultorRegExames = apicultorRegExamesNew;
                }
            }
        }
        return apicultorRegExames;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorRegExames() {
        apicultorRegExames = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<RegEnxames> getExameOrigemRegExames() {
        if (exameOrigemRegExames == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            RegEnxamesDao targetDao = daoSession.getRegEnxamesDao();
            List<RegEnxames> exameOrigemRegExamesNew = targetDao._queryApicultor_ExameOrigemRegExames(id);
            synchronized (this) {
                if(exameOrigemRegExames == null) {
                    exameOrigemRegExames = exameOrigemRegExamesNew;
                }
            }
        }
        return exameOrigemRegExames;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetExameOrigemRegExames() {
        exameOrigemRegExames = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<RegPragas> getApicultorRegPragas() {
        if (apicultorRegPragas == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            RegPragasDao targetDao = daoSession.getRegPragasDao();
            List<RegPragas> apicultorRegPragasNew = targetDao._queryApicultor_ApicultorRegPragas(id);
            synchronized (this) {
                if(apicultorRegPragas == null) {
                    apicultorRegPragas = apicultorRegPragasNew;
                }
            }
        }
        return apicultorRegPragas;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorRegPragas() {
        apicultorRegPragas = null;
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<TrocasCera> getApicultorTorocaCera() {
        if (apicultorTorocaCera == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            TrocasCeraDao targetDao = daoSession.getTrocasCeraDao();
            List<TrocasCera> apicultorTorocaCeraNew = targetDao._queryApicultor_ApicultorTorocaCera(id);
            synchronized (this) {
                if(apicultorTorocaCera == null) {
                    apicultorTorocaCera = apicultorTorocaCeraNew;
                }
            }
        }
        return apicultorTorocaCera;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetApicultorTorocaCera() {
        apicultorTorocaCera = null;
    }

    /** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.delete(this);
    }

    /** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.update(this);
    }

    /** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.refresh(this);
    }

}
